package com.qqtech.qquan.order.model;

import java.math.BigDecimal;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;
import com.qqtech.core.common.util.TimeUtil;
import com.qqtech.qquan.mall.enums.MallConst;
import com.qqtech.qquan.order.enums.OrderBaseSendDeliveryStatusDictEnum;
import com.qqtech.qquan.pub.model.PubFeedback;
import com.qqtech.qquan.send.model.SendDeliveryOrderVo;

@SuppressWarnings("serial")
public class OrderBaseVo extends OrderBase {
	/**
	 * 收货人
	 */
	private String consignee;
	/**
	 * 收货人电话
	 */
	private String phone;

	/**
	 * 收货地址
	 */
	private String address;

	/**
	 * 付款状态名称
	 */
	private String payStatusName;

	/**
	 * 卖方昵称
	 */
	private String sellerNick;
	/**
	 * 店铺名称
	 */
	private String shopName;

	/**
	 * 卖方头像
	 */
	private String sellerLogo;

	/**
	 * 买方昵称
	 */
	private String buyerNick;

	/**
	 * 买方头像
	 */
	private String buyerLogo;

	/**
	 * 订单详细
	 */
	private List<OrderItem> orderItems;
	/**
	 * 订单评论数据
	 */
	private List<PubFeedback> feedbackList;

	/**
	 * 收货地址ID
	 */
	private Integer addressId;

	/** 发货时，选择是否需要物流 */
	private Integer hasNeedDelivery;

	/** 快递或物流公司名称 */
	private String deliveryName;
	/** 快递或物流单号 */
	private String deliveryNo;
	/** 是否显示取消订单按钮 */
	private boolean showCancel;
	/** 是否允许取消订单 */
	private boolean cancelEnable;
	/** 是否显示评价按钮 */
	private boolean showFeedback;
	/** 是否是否显示确认收货按钮 */
	private boolean showComplete;
	/** 是否显示支付按钮 */
	private boolean showPay;
	/** 是否显示审核退款按钮(卖家订单) */
	private boolean showReturnAudit;
	/** 是否显示申请退款按钮(买家订单) */
	private boolean showReturnPay;
	/** 订单状态前端展示 */
	private String orderStatusText;

	/** 索引 */
	private Integer index;

	/** 是否有操作按钮 **/
	private boolean hasBtn;
	/** 是否显示发货按钮 */
	private boolean showDelivery;

	/** 配送单 */
	private List<SendDeliveryOrderVo> sendDeliveryOrderList;
	/** 配送人名字 */
	private String sendDeliveryUserName;

	/** 物流评分 */
	private Integer deliveryScore;
	/** 物流评价内容 */
	private String deliveryContent;
	/** 卖家评分 */
	private Integer sellerScore;
	/** 订单所属店铺种类 1-邻里店;2-社区店铺 **/
	private Integer shopStyle;

	/** 余额支付 **/
	private BigDecimal cashPay;
	/** 圈币支付额 **/
	private BigDecimal quanPay;
	/** 支付宝支付额 **/
	private BigDecimal aliPay;
	/** 微信支付额 **/
	private BigDecimal weixinPay;
	/** 优惠券支付(抵扣) **/
	private BigDecimal couponPay;

	/** 平台满减描述 */
	private String salesQuanStr;
	/** 商家满减描述 */
	private String salesShopStr;
	
	/**社区名称**/
	private String communityName;

	private Integer userOrderCount;

	public Integer getShopStyle() {
		return shopStyle;
	}

	public void setShopStyle(Integer shopStyle) {
		this.shopStyle = shopStyle;
	}

	public boolean isCancelEnable() {
		return cancelEnable;
	}

	public void setCancelEnable(boolean cancelEnable) {
		this.cancelEnable = cancelEnable;
	}

	public String getDeliveryContent() {
		return deliveryContent;
	}

	public void setDeliveryContent(String deliveryContent) {
		this.deliveryContent = deliveryContent;
	}

	public Integer getDeliveryScore() {
		return deliveryScore;
	}

	public void setDeliveryScore(Integer deliveryScore) {
		this.deliveryScore = deliveryScore;
	}

	public Integer getSellerScore() {
		return sellerScore;
	}

	public void setSellerScore(Integer sellerScore) {
		this.sellerScore = sellerScore;
	}

	public String getSendDeliveryUserName() {
		return sendDeliveryUserName;
	}

	public void setSendDeliveryUserName(String sendDeliveryUserName) {
		this.sendDeliveryUserName = sendDeliveryUserName;
	}

	public List<SendDeliveryOrderVo> getSendDeliveryOrderList() {
		return sendDeliveryOrderList;
	}

	public void setSendDeliveryOrderList(List<SendDeliveryOrderVo> sendDeliveryOrderList) {
		this.sendDeliveryOrderList = sendDeliveryOrderList;
	}

	public String getAddress() {
		return address;
	}

	public Integer getAddressId() {
		return addressId;
	}

	public String getBuyerLogo() {
		return buyerLogo;
	}

	public String getBuyerNick() {
		return buyerNick;
	}

	public String getConsignee() {
		return consignee;
	}

	public String getDeliveryName() {
		return deliveryName;
	}

	public String getDeliveryNo() {
		return deliveryNo;
	}

	public List<PubFeedback> getFeedbackList() {
		return feedbackList;
	}

	public String getFullImg() {
		if (StringUtil.isNotBlank(getImg())) {
			return super.getFileDomain() + "" + getImg();
		}
		return null;
	}

	public Integer getHasNeedDelivery() {
		return hasNeedDelivery;
	}

	public Integer getIndex() {
		return index;
	}

	public List<OrderItem> getOrderItems() {
		return orderItems;
	}

	public String getOrderStatusText() {
		return orderStatusText;
	}

	public String getPayStatusName() {
		return payStatusName;
	}

	public String getPhone() {
		return phone;
	}

	public String getSellerLogo() {
		return sellerLogo;
	}

	public String getSellerNick() {
		return sellerNick;
	}

	public String getStrDeliveryStatusAt() {
		return TimeUtil.getStringTimeByFormat(this.getDeliveryStatusAt(), "yyyy-MM-dd HH:mm");
	}

	public String getStrOrderStatusAt() {
		return TimeUtil.getStringTimeByFormat(this.getOrderStatusAt(), "yyyy-MM-dd HH:mm");
	}

	public String getStrPayStatusAt() {
		return TimeUtil.getStringTimeByFormat(this.getPayStatusAt(), "yyyy-MM-dd HH:mm");
	}

	public String getStrReturnPayStatusAt() {
		return TimeUtil.getStringTimeByFormat(this.getReturnPayStatusAt(), "yyyy-MM-dd HH:mm");
	}

	public boolean isHasBtn() {
		return hasBtn;
	}

	public boolean isShowCancel() {
		return showCancel;
	}

	public boolean isShowComplete() {
		return showComplete;
	}

	public boolean isShowDelivery() {
		return showDelivery;
	}

	public boolean isShowFeedback() {
		return showFeedback;
	}

	public boolean isShowPay() {
		return showPay;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setAddressId(Integer addressId) {
		this.addressId = addressId;
	}

	public void setBuyerLogo(String buyerLogo) {
		this.buyerLogo = buyerLogo;
	}

	public void setBuyerNick(String buyerNick) {
		this.buyerNick = buyerNick;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}

	public void setDeliveryName(String deliveryName) {
		this.deliveryName = deliveryName;
	}

	public void setDeliveryNo(String deliveryNo) {
		this.deliveryNo = deliveryNo;
	}

	public void setFeedbackList(List<PubFeedback> feedbackList) {
		this.feedbackList = feedbackList;
	}

	public void setHasBtn(boolean hasBtn) {
		this.hasBtn = hasBtn;
	}

	public void setHasNeedDelivery(Integer hasNeedDelivery) {
		this.hasNeedDelivery = hasNeedDelivery;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public void setOrderItems(List<OrderItem> orderItems) {
		this.orderItems = orderItems;
	}

	public void setOrderStatusText(String orderStatusText) {
		this.orderStatusText = orderStatusText;
	}

	public void setPayStatusName(String payStatusName) {
		this.payStatusName = payStatusName;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public void setSellerLogo(String sellerLogo) {
		this.sellerLogo = sellerLogo;
	}

	public void setSellerNick(String sellerNick) {
		this.sellerNick = sellerNick;
	}

	public void setShowCancel(boolean showCancel) {
		this.showCancel = showCancel;
	}

	public void setShowComplete(boolean showComplete) {
		this.showComplete = showComplete;
	}

	public void setShowDelivery(boolean showDelivery) {
		this.showDelivery = showDelivery;
	}

	public void setShowFeedback(boolean showFeedback) {
		this.showFeedback = showFeedback;
	}

	public void setShowPay(boolean showPay) {
		this.showPay = showPay;
	}

	public boolean isShowReturnPay() {
		return showReturnPay;
	}

	public void setShowReturnPay(boolean showReturnPay) {
		this.showReturnPay = showReturnPay;
	}

	public String getStrSendDeliveryStatus() {
		if (getSendDeliveryStatus() == null) {
			return "";
		} else if (getSendDeliveryStatus().intValue() == OrderBaseSendDeliveryStatusDictEnum.NOTDELIVERY.getCode()) {
			return "待配送";
		} else if (getSendDeliveryStatus().intValue() == OrderBaseSendDeliveryStatusDictEnum.DELIVERYING.getCode()) {
			return "配送中";
		} else {
			return "已配送";
		}
	}

	public boolean isShowReturnAudit() {
		return showReturnAudit;
	}

	public void setShowReturnAudit(boolean showReturnAudit) {
		this.showReturnAudit = showReturnAudit;
	}

	public String getStrSendDeliveryAt() {
		return TimeUtil.getStringTimeByFormat(getSendDeliveryAt(), "yyyy-MM-dd HH:mm");
	}

	public String getPathImg() {
		if (StringUtil.isBlank(this.getImg())) {
			return "";
		}
		return this.getImgHandleDomain() + this.getImg() + MallConst.IMG_BRAND;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	public BigDecimal getQuanPay() {
		return quanPay;
	}

	public void setQuanPay(BigDecimal quanPay) {
		this.quanPay = quanPay;
	}

	public BigDecimal getAliPay() {
		return aliPay;
	}

	public void setAliPay(BigDecimal aliPay) {
		this.aliPay = aliPay;
	}

	public BigDecimal getWeixinPay() {
		return weixinPay;
	}

	public void setWeixinPay(BigDecimal weixinPay) {
		this.weixinPay = weixinPay;
	}

	public BigDecimal getCashPay() {
		return cashPay;
	}

	public void setCashPay(BigDecimal cashPay) {
		this.cashPay = cashPay;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public BigDecimal getCouponPay() {
		return couponPay;
	}

	public void setCouponPay(BigDecimal couponPay) {
		this.couponPay = couponPay;
	}

	public String getSalesQuanStr() {
		return salesQuanStr;
	}

	public void setSalesQuanStr(String salesQuanStr) {
		this.salesQuanStr = salesQuanStr;
	}

	public String getSalesShopStr() {
		return salesShopStr;
	}

	public void setSalesShopStr(String salesShopStr) {
		this.salesShopStr = salesShopStr;
	}

	public String getCommunityName() {
		return communityName;
	}

	public void setCommunityName(String communityName) {
		this.communityName = communityName;
	}

	public Integer getUserOrderCount() {
		return userOrderCount;
	}

	public void setUserOrderCount(Integer userOrderCount) {
		this.userOrderCount = userOrderCount;
	}
}